package com.airforce.mappers;

import com.airforce.model.wechat_user;
import org.apache.ibatis.jdbc.SQL;

public class wechat_userSqlProvider {

    public String insertSelective(wechat_user record) {
        SQL sql = new SQL();
        sql.INSERT_INTO("wechat_user");
        
        if (record.getId() != null) {
            sql.VALUES("id", "#{id,jdbcType=INTEGER}");
        }
        
        if (record.getName() != null) {
            sql.VALUES("name", "#{name,jdbcType=VARCHAR}");
        }
        
        if (record.getOpenid() != null) {
            sql.VALUES("openid", "#{openid,jdbcType=VARCHAR}");
        }
        
        if (record.getZone() != null) {
            sql.VALUES("zone", "#{zone,jdbcType=VARCHAR}");
        }
        
        if (record.getAnswernum() != null) {
            sql.VALUES("answernum", "#{answernum,jdbcType=INTEGER}");
        }
        
        if (record.getNowanswer() != null) {
            sql.VALUES("nowanswer", "#{nowanswer,jdbcType=INTEGER}");
        }
        
        if (record.getAvatarurl() != null) {
            sql.VALUES("avatarURL", "#{avatarurl,jdbcType=VARCHAR}");
        }
        
        if (record.getCreatetime() != null) {
            sql.VALUES("createtime", "#{createtime,jdbcType=TIMESTAMP}");
        }
        
        if (record.getUpdatetime() != null) {
            sql.VALUES("updatetime", "#{updatetime,jdbcType=TIMESTAMP}");
        }
        
        if (record.getShare() != null) {
            sql.VALUES("share", "#{share,jdbcType=TINYINT}");
        }
        
        if (record.getSharenum() != null) {
            sql.VALUES("sharenum", "#{sharenum,jdbcType=INTEGER}");
        }
        
        if (record.getServicesname() != null) {
            sql.VALUES("servicesname", "#{servicesname,jdbcType=VARCHAR}");
        }
        
        if (record.getIsuser() != null) {
            sql.VALUES("isuser", "#{isuser,jdbcType=INTEGER}");
        }
        
        if (record.getUuid() != null) {
            sql.VALUES("uuid", "#{uuid,jdbcType=VARCHAR}");
        }
        
        return sql.toString();
    }

    public String updateByPrimaryKeySelective(wechat_user record) {
        SQL sql = new SQL();
        sql.UPDATE("wechat_user");
        
        if (record.getName() != null) {
            sql.SET("name = #{name,jdbcType=VARCHAR}");
        }
        
        if (record.getOpenid() != null) {
            sql.SET("openid = #{openid,jdbcType=VARCHAR}");
        }
        
        if (record.getZone() != null) {
            sql.SET("zone = #{zone,jdbcType=VARCHAR}");
        }
        
        if (record.getAnswernum() != null) {
            sql.SET("answernum = #{answernum,jdbcType=INTEGER}");
        }
        
        if (record.getNowanswer() != null) {
            sql.SET("nowanswer = #{nowanswer,jdbcType=INTEGER}");
        }
        
        if (record.getAvatarurl() != null) {
            sql.SET("avatarURL = #{avatarurl,jdbcType=VARCHAR}");
        }
        
        if (record.getCreatetime() != null) {
            sql.SET("createtime = #{createtime,jdbcType=TIMESTAMP}");
        }
        
        if (record.getUpdatetime() != null) {
            sql.SET("updatetime = #{updatetime,jdbcType=TIMESTAMP}");
        }
        
        if (record.getShare() != null) {
            sql.SET("share = #{share,jdbcType=TINYINT}");
        }
        
        if (record.getSharenum() != null) {
            sql.SET("sharenum = #{sharenum,jdbcType=INTEGER}");
        }
        
        if (record.getServicesname() != null) {
            sql.SET("servicesname = #{servicesname,jdbcType=VARCHAR}");
        }
        
        if (record.getIsuser() != null) {
            sql.SET("isuser = #{isuser,jdbcType=INTEGER}");
        }
        
        if (record.getUuid() != null) {
            sql.SET("uuid = #{uuid,jdbcType=VARCHAR}");
        }
        
        sql.WHERE("id = #{id,jdbcType=INTEGER}");
        
        return sql.toString();
    }
}